// 创建一个路由，并暴露出去

// 引入createRouter
import { createRouter,createWebHistory } from "vue-router";

import Home from '@/pages/Home.vue'
import News from '@/pages/News.vue'
import About from '@/pages/About.vue'
import NewsConten from '@/components/NewsConten.vue'
// 创建路由器
const router = createRouter({
    history:createWebHistory(),//路由器的工作模式
    routes: [//路由规则
        {
            name:'home',
            path: '/home',
            component:Home     
        },
        {
            name:'news',
            path: '/news',
            component: News,
            children: [
                {
                    name:'xwlb',
                    path: 'newsconten/:id/:title/:content?',
                    component:NewsConten
                },
            ]
        },
        {
            name:'about',
            path: '/about',
            component:About     
        },
       
    ]
})

export default router